# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=base64c
pkgver=0.2.1
pkgrel=0
pkgdesc="Base64 encoding/decoding library for C"
url="https://gitlab.nic.cz/turris/base64c"
arch="all"
license="MIT"
makedepends="
	autoconf
	automake
	libtool
	"
checkdepends="check-dev"
subpackages="$pkgname-dev"
source="https://gitlab.nic.cz/turris/base64c/-/archive/v$pkgver/base64c-v$pkgver.tar.bz2
	no-valgrind.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"

prepare() {
	default_prepare
	./bootstrap
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		$(want_check && echo '--enable-tests' || :)
	make
}

check() {
	make check
}

package() {
	make install DESTDIR="$pkgdir"
}

sha512sums="
6183b8314ce7066b3fabfc155606da76d9690ff9ada924e64c86e607d050c453a0fd9a245ee8de732e7daccb5bd532c03e0b191f4f4cf1d49f97973461757754  base64c-v0.2.1.tar.bz2
1c3d5617839107bf45e9fda590acce3fb9ab97f70b55ac49fd47d595e53fdbdd81ae65407f98efe21b9b34e1d711b706a2d25c6b69b121058207006622cceb9d  no-valgrind.patch
"
